package com.example.demo.service.impl;

import com.example.demo.bean.pmsProduct.PmsProductImage;
import com.example.demo.bean.pmsProduct.PmsProductInfo;
import com.example.demo.mapper.pmsProductMapper.PmsProductImageMapper;
import com.example.demo.mapper.pmsProductMapper.PmsProductInfoMapper;
import com.example.demo.service.PmsProductInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class PmsProductInfoServiceImpl implements PmsProductInfoService {
    @Autowired
    PmsProductInfoMapper pmsProductInfoMapper;
    @Autowired
    PmsProductImageMapper pmsProductImageMapper;
    @Override
    public List<PmsProductInfo> getAll(String catalog3Id) {
        PmsProductInfo pmsProductInfo = new PmsProductInfo();
        pmsProductInfo.setCatalog3Id(catalog3Id);
        return pmsProductInfoMapper.select(pmsProductInfo);
    }
    @Override
    public PmsProductInfo getPmsProductInfo(String id) {
        PmsProductInfo pmsProductInfo = new PmsProductInfo();
        pmsProductInfo.setId(id);
        return  pmsProductInfoMapper.selectOne(pmsProductInfo);
    }

    @Override
    public List<PmsProductImage> getPmsProductImage(String proudctId) {
        PmsProductImage pmsProductImage = new PmsProductImage();
        pmsProductImage.setProductId(proudctId);
        return pmsProductImageMapper.select(pmsProductImage);
    }
}
